<template>
  <div class="dialog">
    <el-dialog
      :title="titleText"
      :visible.sync="showDialog"
      width="35%"
      top="0"
      :close-on-click-modal="false"
      @close="cancel"
    >
      <div v-loading="loadFilesing" style="width:100%">
        <el-timeline>
          <el-timeline-item
            v-for="(activity, index) in editObject.hitchApplyAuditPersonMapperList"
            :key="index"
            :type="activity.type"
            :color="activity.pass ? '#0bbd87' : (activity.pass !== false ? '' : 'red') "
            :size="activity.size"
            :timestamp="activity.applyTime || ''"
          >{{activity.personName }} {{ activity.pass ? '审批通过' : (activity.pass !== false ? '未审核' : '审批不通过') }} {{ activity.pass === false ? '原因：' + activity.reason : '' }}</el-timeline-item>
        </el-timeline>
        <p
          v-if="editObject.hitchApplyAuditPersonMapperList&&editObject.hitchApplyAuditPersonMapperList.length === 0 && !loadFilesing"
          class="hang-font"
        >暂无内容</p>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button class="cancelbtn" @click="cancel()">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "",
  components: {},
  props: {
    // 弹框名称
    titleText: {
      type: String,
      default: "",
    },
    show: {
      type: Boolean,
      default: false,
    },
    editObject: {
      type: [Object],
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      showDialog: this.show,
      videoList: [],
      loadFilesing: false,
    };
  },

  watch: {
    show(v) {
      this.showDialog = v;
    },
    editObject() {},
    titleText(v) {
      if (v && (v === "故障视频" || v === "维修视频")) {
        this.videoList = [];
        // this.query();
        // this.queryVideo();
      }
    },
  },
  created() {},
  mounted() {},
  methods: {
    // query() {
    //   // 获取数据
    //   if (this.editObject.hitchInfoCode) {
    //     this.loadFilesing = true;
    //     failureToReportApi
    //       .queryByHitchInfoId(this.editObject.hitchInfoCode)
    //       .then(res => {
    //         if (res.code === 1) {
    //           let data = res.data || [];
    //           this.videoList = [];
    //           if (data) {
    //             data.forEach(a => {
    //               if (a.pictureType === "video/mp4") {
    //                 a.url = this.deal(a["pictureData"]);
    //                 this.videoList.push(a);
    //               }
    //             });
    //           }
    //           this.loadFilesing = false;
    //         } else {
    //           this.$message.error(res.msg);
    //         }
    //       });
    //   }
    // },
    close() {
      this.$emit("closeDialog");
    },
    cancel() {
      this.$emit("cancelDialog");
    },
  },
};
</script>

<style lang="scss" scoped>
.video-con {
  width: 100%;
  height: 300px;
}
::v-deep .el-dialog__body {
  max-height: 500px;
  overflow-y: auto !important;
  overflow-x: hidden;
}
.hang-font {
  width: 100%;
  font-size: 16px;
  text-align: center;
}
</style>
